package com.game.modular.game.battle.panel.attribute.domain;

import com.game.modular.game.battle.panel.skillEffect.PvpSkillEffect;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.*;

@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class EffectStatus {
    private Long status;// 状态
    private Integer coreSkillType; // 技能效果类型
    private Long coreSkillEffectId;// 技能效果id
    private Integer baseKeep; // 持续回合
    private Integer start; // 开始回合(获取的回合)

    private Integer baseUseNum; // 使用次数
    private Integer useNum; // 使用次数

    private Set<Integer> refreshRound = new HashSet<>();
    private Double magicInfluence;// 伤害率  普通攻击为1  其他情况看指定

    private PvpSkillEffect skillEffect;

    public boolean use() {
        if (baseUseNum == -1) {
            return true;
        }
        if (baseUseNum >0){
            useNum -= 1;
            return useNum >= 0;
        }
        return false;
    }

    public void refreshStatus(Integer round) {
        boolean add = refreshRound.add(round);
        if (add) {
            useNum = baseUseNum;
        }
    }
}
